{include file="public/header"}
<style>
    #message, .message {
    position: fixed;
    top: 500px;
    left: 47%;
    width: 220px;
    margin-left: -100px;
    border-width:0;
    border-radius: 0.6em;
    color:#ffffff;
    background-color: rgba(0, 0, 0, 0.7);
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
    padding: 10px;
    text-align:center;
    z-index:1500;
    -webkit-transition: opacity 1s ease-out; /* Saf3.2+, Chrome */
    -moz-transition: opacity 1s ease-out; /* FF4+ */
    -ms-transition: opacity 1s ease-out; /* IE10? */
    -o-transition: opacity 1s ease-out; /* Opera 10.5+ */
    transition: opacity 1s ease-out; }
</style>
<div style="background:url({if isset($pcate_info)} {$pcate_info['pic']} {else} {$cate_info['pic']} {/if}) no-repeat center top; height:200px; width:100%"></div>


<div class="middle">
    <div class="rzxq">
        <h3>{if isset($pcate_info)}{$pcate_info['name']}{else}{$cate_info['name']}{/if}</h3>
        <div class="nr" style=" padding-top:5px; padding-bottom:15px;">
            <ul>
                {if isset($cate_child)}
                    {volist name="cate_child" id="vo"}
                        <li>
                            <a href="{:url('article/index')}?cid={$vo.id}" {if $vo.id==$cate_info['id']} class="xz"  {/if}>
                                {$vo.name}
                            </a>
                        </li>
                    {/volist}
                {/if}

            </ul>
        </div>
        <div style="height:10px; width:100%; overflow:hidden"></div>
        <h3>联系我们</h3>
        <div class="nr"><p><img src="/static/index/image/lxwm.jpg" width="238" /></p>
            <p style="padding-top:10px;"><strong>西安鲍秀兰儿童智力开发有限公司</strong><br />
                地址：西安市太华路大明宫中央广场B座15层<br />
                电话：400-090-2929　029-81016266 81016299<br />邮箱：3212687920@qq.com<br />网址：www.babybluechina.com</p>
        </div>
    </div>
    <div class="xw">
        <div class="xwdt">
            <h3>{$cate_info['name']}</h3>
            <p>当前位置：<a href="{:url('index/index')}">首页</a> >> <a href="{:url('article/index')}?cid={$cid}" >{$cate_info['name']}</a></p>
        </div>
        <div class="xwxq">
            <!-------------------------------内容展示开始------------------------------->

            <!--文字列表-->

            <!--单篇文章-->
            {if $cate_info['type']==4 || isset($aid)}
                {if isset($article_info['title'])}
                    <div class="active" id="shownews">
                        <h1 class="title" style="font-size:16px; padding-top:5px; color:">{$article_info['title']}<div style="float:right; color:#666;font-size:12px">点击次数：<span>{$article_info['views']}</span>&nbsp;&nbsp;更新时间：{$article_info['updatetime']}</div>
                    </div></h1>

                        {if isset($article_info['content'])&&$article_info['content']}
                            {$article_info['content']}
                        {else}
                            <div class="active" id="shownews">
                                <p style="text-align: center;">
                                    <video src="{$article_info['video']}" poster="{$article_info['videoposter']}" width="600" height="500"  controls="controls">
                                    </video>
                                </p>
                            </div>
                        {/if}
                    </div>
                {/if}

            {elseif $cate_info['type']==1}
                <table width="100%" border="0" cellspacing="0" cellpadding="0" style="line-height:30px;">
                    {volist name="article_list" id="vo"}
                        <tr>
                            <td width="2%"><img src="/static/index/image/dian2.jpg" ></td>
                            <td width="86%" align="left" valign="middle"><a href="{:url('article/index')}?aid={$vo.id}&cid={$vo.cid}" title="{$vo.title}">{$vo.title}</a></td>
                            <td width="12%" align="right" valign="middle" style="color:#666;">{$vo.updatetime|date="Y-m-d",###}</td>
                        </tr>
                    {/volist}
                </table>

            <!--图片列表-->
            {elseif $cate_info['type']==2}
                <ul style="width:940px;">
                    {volist name="article_list" id="vo"}
                        <li style="width:296px; float:left; padding:0px 16px 5px 0px; text-align:center">
                            <div style="height:340px; overflow:hidden">
                                <a title={$vo.title} href="{:url('article/index')}?aid={$vo.id}&cid={$vo.cid}" >
                                    <img src="{$vo.poster}"  alt="{$vo.title}"  width="290" height="334" border="0" class="imgbk" />
                                </a>
                            </div>
                            <p style="line-height:35px; height:35px;">
                                <a title="{$vo.title}" href="{:url('article/index')}?aid={$vo.id}&cid={$vo.cid}" >
                                    {$vo.title}
                                </a>
                            </p>
                        </li>
                    {/volist}
                </ul>
                <div class="clear"></div>

            <!--视频列表-->
            {elseif $cate_info['type']==3}
                {volist name="article_list" id="vo"}
                    <ul style="width:935px;">
                        <li style="width:295px; float:left; padding:0px 15px 5px 1px; text-align:center">
                            <div style="height:209px; overflow:hidden">
                                <a title="{$vo.title}" href="{:url('article/index')}?aid={$vo.id}&cid={$vo.cid}" >
                                    <img src="{$vo.videoposter}"  width="289" height="203"" border="0" class="imgbk" />
                                </a>
                            </div>
                            <p style="line-height:35px; height:35px;overflow:hidden">
                                <a title="{$vo.title}" href="{:url('article/index')}?aid={$vo.id}&cid={$vo.cid}">
                                    {$vo.title}
                                </a>
                            </p>
                        </li>
                    </ul>
                {/volist}
                <div class="clear"></div>


            {elseif $cate_info['type']==5}
                <div class="active" id="messagelist" style="padding:0px; margin:0px;">
                <h3 class="ctitle" style="font-size:14px; margin:0px;">免费预约</h3>
                <form method='POST' name='myform' onsubmit="return checkparam()"  action="{:url('article/register')}" target='_self'>
                    <table align="center" class='message_table'>
                        <tr>
                            <td class='text'>宝宝姓名</td>
                            <td class='input'><input name='babyname' {if isset($babyname)}value="{$babyname}"{/if} type='text' class='input-text' />
                                <span class='info'>*</span></td>
                        </tr>
                        <tr>
                            <td class='text'>宝宝性别</td>
                            <td class='input'><select name='sex' class='input-text' style="width: 410px; height:35px; line-height:35px;">

                                <option value=1  {if isset($sex) && $sex=="1"}selected="selected"{/if} class='input-text'>男宝宝</option>

                                <option value=2 {if isset($sex) && $sex=="2"}selected="selected"{/if} class='input-text'>女宝宝</option>

                            </select>
                                <span class='info'>*</span></td>
                        </tr>
                        <tr>
                            <td class='text'>宝宝生日</td>
                            <td class='input'><input type="text" {if isset($birthday)}value="{$birthday}"{/if}  maxlength="10" id="bbage" name='birthday' class='input-text'>

                                <span class='info'>*</span></td>
                        </tr>
                        <tr>
                            <td class='text'>联系电话</td>
                            <td class='input'><input name='phone' {if isset($phone)}value="{$phone}"{/if} type='text' class='input-text' />
                                <span class='info'>*</span></td>
                        </tr>

                        <tr>
                            <td class='text'></td>
                            <td class='submint'>
                                <input type='submit'  value='提交' class='submit button orange' style="font-size:14px; width:100px;"></td>
                        </tr>
                    </table>
                </form>
            </div>
            </div>
            {/if}
            <!-------------------------------内容展示结束------------------------------>
        </div>
    </div>
</div>
<div id="message" style="display: none;"></div>
{include file="public/footer"}

<script>
    var t;
    var tt;
    function msg(text) {
    if(g('checkError')!=null){
    hide('checkError');
    }
    if (text == '') {
    return;
    }
    var msgDiv = g('message');
    msgDiv.innerHTML=text;
    msgDiv.style.opacity=1;
    msgDiv.style.filter="alpha(opacity=100)";
    show('message');
    clearTimeout(t);
    clearTimeout(tt);
    tt=setTimeout("test('message')",1500);
    }
    function test(id){
    g(id).style.opacity= 0;
    g(id).style.filter="alpha(opacity=0)";
    t=setTimeout("hide('message')",1000);
    }
    function g(id) {
    return document.getElementById(id);
    }
    function hide(id) {
    g(id).style.display = 'none';
    }
    function show(id) {
    g(id).style.display = 'block';
    }
</script>

<script>
    var record={$record};
    if(record==1){
        msg('预约成功');
    }

    function checkparam()
    {
        if(document.getElementsByName("babyname")[0].value=='')
        {
            msg('宝宝姓名不能为空');
            return false;
        }

        if(document.getElementsByName("birthday")[0].value=='')
        {
            msg('宝宝生日不能为空');
            return false;
        }

        var phone=document.getElementsByName("phone")[0].value
        if(phone=='')
        {
            msg('联系电话不能为空');
            return false;
        }
    }
</script>
